import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path, { join, resolve } from "path";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    createSvgIconsPlugin({
      // 指定需要缓存的图标文件夹
      iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
      // 指定 symbolId格式
       symbolId:'icon-[name]'
    })
  ],
  // 软链接
  resolve: {
    alias: {
      "@": join(__dirname, "/src")
    }
  },
  server: {
    proxy: {
      // 使用 proxy 实例
      "/api": {
        target: "https://api.imooc-front.lgdsunday.club",
        changeOrigin: true
      }
    }
  }
});
